package com.cn.boot.student.controller.student.sign;

import com.cn.boot.student.entity.SignEntity;
import com.cn.boot.student.entity.UserEntity;
import com.cn.boot.student.service.student.ISignService;
import com.cn.boot.student.util.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 学生签到表
 */
@RestController
@Api(tags = "学生签到")
@RequestMapping("/admin/student")
public class SignController {
    @Autowired
    private ISignService iSignService;
    @PostMapping("/sign")
    @ApiOperation(value = "签到")
    @PreAuthorize("hasAuthority('sys:sign:update')")
    public CommonResult sign(SignEntity signEntity){
        return iSignService.sign(signEntity);
    }
    /**
     * 查询签到状态
     */
    @PostMapping("/getSignRecord")
    @ApiOperation(value = "签到状态查询")
    public CommonResult findAll(UserEntity userEntity){
        return iSignService.findAll(userEntity);
    }
}
